/*
 * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙，邂逅框架梦]
 * 
 * https://zhiqim.org/project/zhiqim_framework/zhiqim_httpd.htm
 *
 * Zhiqim Httpd is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */
package org.zhiqim.httpd.context;

import org.zhiqim.httpd.HttpdConstants;
import org.zhiqim.httpd.context.extend.EmptyAction;

/**
 * 定义上下文常量
 *
 * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理
 */
public interface ZmlContextConstants extends HttpdConstants
{
    /********************************************************************************/
    //第一部分，ZML参数配置定义服务配置定义expires      
    /********************************************************************************/
    
    public String _ZML_PATH_EXACTPRIOR_                = "pathExactPrior";
    
    public String _ZML_COOKIE_USE_                     = "cookie.use";
    public String _ZML_COOKIE_DOMAIN_                  = "cookie.domain";
    public String _ZML_COOKIE_PORT_                    = "cookie.port";
    public String _ZML_COOKIE_PATH_                    = "cookie.path";
    public String _ZML_COOKIE_FORCE_                   = "cookie.force";
    public String _ZML_ISENCODEABLE_                   = "isEncodeable";
    
    public String _ZML_SESSION_MANAGER_                = "session.manager";
    public String _ZML_SESSION_TIMEOUT_                = "session.timeout";
    public String _ZML_SESSION_ID_NAME_                = "session.idName";
    public String _ZML_SESSION_ID_MARK_                = "session.idMark";
    public String _ZML_SESSION_MUST_                   = "session.must";
    public String _ZML_SESSION_NOT_                    = "session.not";
    public String _ZML_SESSION_PARAMETER_              = "session.parameter";

    public String _ZML_PATTERN_                        = "zml.pattern";
    public String _ZML_MAX_KEEP_TIME_                  = "zml.maxKeepTime";
    public String _ZML_MAX_IDLE_TIME_                  = "zml.maxIdleTime";
    
    public String _ZML_PATTERN_DEFAULT_                = "*.zml,*.htm";
    
    /********************************************************************************/
    //第二部分，ZML服务配置定义 zml
    /********************************************************************************/
    
    //服务提供定义的路径服务
    public String _PATH_SERVICE_                       = "/service/*";
    public String _PATH_SERVICE_WS_                    = "/service/ws";
    public String _PATH_SERVICE_AJAX_                  = "/service/ajax";
    public String _PATH_SERVICE_RMI_                   = "/service/rmi";
    public String _PATH_SERVICE_UPLOAD_                = "/service/upload";
    public String _PATH_SERVICE_UPLOAD_ACCESS_         = "/service/upl/*";
    public String _PATH_SERVICE_VCODE_                 = "/service/vcode.jpg";
    public String _PATH_SERVICE_RESOURCE_              = "/service/res/*";
    public String _PATH_SERVICE_RES_AVATAR_            = "/service/res/image/pic_avatar.jpg";
    
    //服务前置
    public String _PATH_SERVICE_PREFIX_                = "/service/";
    public String _PATH_RESOURCE_PREFIX_               = "/service/res/";
    public String _PATH_UPLOAD_PREFIX_                 = "/service/upl/";
    
    //服务常用属性
    public String _SERV_AJAX_INTERCEPTOR_              = "ajax.interceptor";
    public String _SERV_UPLOAD_ROOT_DIR_               = "upload.rootDir";
    
    public String _SERV_IP_WHITE_LIST_SUFFIX_          = ".ipWhiteList";
    public String _SERV_IP_BLACK_LIST_SUFFIX_          = ".ipBlackList";
    public String _SERV_IP_DEFAULT_PERMISSION_         = ".ipDefaultPermission";
    
    public String _SERV_RESOURCE_CLASSPATH_            = "/org/zhiqim/httpd/context/service/resource/";
    
    /********************************************************************************/
    //第三部分，ZML上下文环境常量定义
    /********************************************************************************/
    
    /** ZC 目录和服务 */
    public String ZC_CONF_FOLDER                       = "/conf/";
    public String ZC_CONF_CONFIG_XML                   = "/conf/config.xml";
    public String ZC_CONF_CONFIG_ZML                   = "/conf/config.zml";
    public String ZC_FILTER_CONF_FILE                  = "/conf/*";
    public String ZC_FILTER_ZVIEW_FILE                 = "/zview/*";
    public String ZC_FILTER_ZTMPL_HTM                  = "/ztmpl/*.htm";
    public String ZC_FILTER_ZTMPL_ZML                  = "/ztmpl/*.zml";
    public String ZC_RES_ZTMPT_FILE                    = "/ztmpl/*";
    public String ZC_RES_ZRES_FILE                     = "/zres/*";

    public String ZC_MATCH_PREFIX                      = "_match_";
    public String ZC_VCODE_SESSION_NAME                = "_vcode_";
    public String ZC_EMPTY_ACTION_NAME                 = EmptyAction.class.getName();
    
    /** ZC 属性名多组件内多个 */
    public String ZC_BOOTSTRAP                         = "bootstrap";
    public String ZC_ACTION_PACKAGE                    = "actionPackage";
    
    /** ZC 属性名组件依次重写 */
    public String ZC_ZHIQIM_CSS                        = "zhiqim.css";
    public String ZC_ZHIQIM_JS                         = "zhiqim.js";
    
    public String ZC_ZHIQIM_MOBILE_CSS                 = "zhiqim.mobile.css";
    public String ZC_ZHIQIM_MOBILE_JS                  = "zhiqim.mobile.js";
    
    /********************************************************************************/
    //第四部分，ZML上下文配置文件常量定义
    /********************************************************************************/
    
    /** ZC DTD/XML格式 */
    public String ZC_VERSION                           = "V8.0.4";
    public String ZC_DTD_PUBLIC_ID                     = "-//ZHIQIM //DTD Zhiqim-Context Configuration 8.0.0//EN";
    public String ZC_DTD_PATH                          = "/org/zhiqim/httpd/context/config/zhiqim_context_8_0_0.dtd";
    public String ZC_DTD_URL                           = "https://zhiqim.org/xmldtds/zhiqim_context_8_0_0.dtd";
    
    public String ZC_XML_DOCTYPE                       = "<!DOCTYPE zhiqim-context PUBLIC \""+ ZC_DTD_PUBLIC_ID+ "\" \""+ ZC_DTD_URL +"\">";
    
    public String ZC_XML_HEAD                          = "<zhiqim-context>";
    public String ZC_XML_TAIL                          = "</zhiqim-context>";
    
    /** ZC 核心定义，包括组件、子配置、属性、拦截器和执行器 */
    public String ZC_COMPONENT                         = "component";
    public String ZC_CONFIG                            = "config";
    public String ZC_ATTRIBUTE                         = "attribute";
    public String ZC_INTERCEPTOR                       = "interceptor";
    public String ZC_ACTION                            = "action";
    
    /** ZC 字段名 */
    public String ZC_NAME                              = _NAME_;
    public String ZC_TYPE                              = _TYPE_;
    public String ZC_KEY                               = _KEY_;
    public String ZC_VALUE                             = _VALUE_;
    public String ZC_CLASS                             = _CLASS_;
    public String ZC_PATH                              = "path";
    public String ZC_FORWARD                           = "forward";
    public String ZC_REDIRECT                          = "redirect";
    public String ZC_VIEW                              = "view";
    public String ZC_INCLUDE                           = "include";
    public String ZC_METHOD                            = "method";
    public String ZC_SUCCESS                           = "success";
    public String ZC_TIPS                              = "tips";
    
    /********************************************************************************/
    //第五部分，响应常量定义
    /********************************************************************************/
    
    public String _PATH_RETURN_RESULT_                 = "/conf/return/returnResult.zml";
    public String _PATH_RETURN_FRAME_                  = "/conf/return/returnFrame.zml";
    
    /********************************************************************************/
    //第六部分，Service/Action等常量定义
    /********************************************************************************/
    
    /** ZC Action常用的配置 */
    public String EXEC                                 = "exec";
    public String LIST                                 = "list";
    public int INT_LIST                                = 3322014;      //"list".hashCode();
    public int INT_ITEM                                = 3242771;      //"item".hashCode();
    public int INT_ADD                                 = 96417;        //"add".hashCode();
    public int INT_MODIFY                              = -1068795718;  //"modify".hashCode();
    public int INT_INSERT                              = -1183792455;  //"insert".hashCode();
    public int INT_UPDATE                              = -838846263;   //"update".hashCode();
    public int INT_DELETE                              = -1335458389;  //"delete".hashCode();
}
